<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/11 0011
 * Time: 上午 3:34
 */
Route::group(['namespace' => 'Admin', 'middleware' => 'web', 'prefix' => '/admin'], function () {
    Route::get( 'index',               'AdminController@index');
    Route::post('login',               'AdminController@login');
    Route::get( 'logout',              'AdminController@logout');
});

Route::group(['namespace' => 'Admin', 'middleware' => 'admin', 'prefix' => '/admin'], function () {
    Route::get( 'home',                'AdminController@home');
    Route::get( 'viewAddSentence',     'SentenceController@viewAddSentence');
    Route::get( 'viewAddSentences',    'SentenceController@viewAddSentences');
    Route::get( 'wordHub',             'WordController@viewWordHub');
    Route::get( 'sentenceHub',         'SentenceController@viewSentenceHub');

    Route::get( 'viewAboutUs',         'HelpController@viewAboutUs');
    Route::get( 'viewCustomerService', 'HelpController@viewCustomerService');
    Route::get( 'viewHelp',            'HelpController@viewHelp');
});

Route::group(['namespace' => 'Admin', 'middleware' => 'adminAction', 'prefix' => '/admin'], function () {
    Route::post('addSentences',        'SentenceController@addSentences');
    Route::post('addSentence',         'SentenceController@addSentence');

    Route::post('updateAboutUs',       'HelpController@updateAboutUs');
    Route::post('updateCustomerService','HelpController@updateCustomerService');
    Route::post('updateHelp',          'HelpController@updateHelp');
});